import QtQuick
import QtQuick.Layouts

import Fk
import Fk.Components.LunarLTK

ColumnLayout {
  id: root
  anchors.fill: parent
  property var extra_data: ({ name: "", data: [] })
  signal finish()

  BigGlowText {
    Layout.fillWidth: true
    Layout.preferredHeight: childrenRect.height + 4

    text: Lua.tr(extra_data.name)
  }

  ListView {
    id: body
    Layout.fillWidth: true
    Layout.fillHeight: true

    clip: true
    spacing: 10

    model: extra_data.data

    delegate: Item { // 每个战法模块
      width: body.width
      height: talentDesc.height + 5

      Rectangle {// 背景
        anchors.fill: parent

        color: "#c4c4c4"
        opacity: .6
        radius: 3
      }

      Row  {

      Image { // 战法图标
        id: markImg
        x: 5
        fillMode: Image.PreserveAspectCrop
        source: SkinBank.getMarkPic("@!mark_" + modelData.name)
      }
    
      Text {
        id: talentDesc

        width: body.width - markImg.width - 5
        font.pixelSize: 18
        color: "#E4D5A0"
        text: "<b>" + Lua.tr(modelData.name) + modelData.style + "</b>: " + modelData.desc

        wrapMode: TextEdit.WordWrap
        textFormat: TextEdit.RichText
      }

      }
    }
  }
}

